home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Debug / Assert.cp next >
Text File  |  1997-06-28  |  642b  |  35 lines

  1. // Assert.cp
  2.  
  3. #ifndef Assert_h
  4. #include "Assert.h"
  5. #endif
  6. #ifndef ConstCString_h
  7. #include "ConstCString.h"
  8. #endif
  9.  
  10. static const int8 *PathTail( const int8 *path )
  11.   {
  12.     const int8 *tail = path;
  13.     for ( const int8 *p = path; *p!= 0; p++ )
  14.         if ( *p == ':' )
  15.             tail = p + 1;
  16.     
  17.     return tail;
  18.   }
  19.  
  20. DebugMessage AssertionMessage( const int8 *file,
  21.                                          uint32 line,
  22.                                          const int8 *condition )
  23.   {
  24.     DebugMessage message;
  25.     
  26.     message += "\pAssertion failure at line ";
  27.     message += line;
  28.     message += "\p of ";
  29.     message += ConstCString( PathTail( file ) );
  30.     message += "\p: ";
  31.     message += ConstCString( condition );
  32.     
  33.     return message;
  34.   }
  35.